package com.gopay.common.domain.report;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;


/**
 * The persistent class for the REPORT_CONSOLE_BALANCE_QUERY database table.
 * 
 */
@Entity
@Table(name="REPORT_CONSOLE_BALANCE_QUERY")
public class ReportConsoleBalanceQuery implements Serializable {
	private static final long serialVersionUID = 1L;

	private int id;

	private String acctId;

	private String acctProdCode;

	private Date acctTs;

	private BigDecimal balAmt;

	private Date createdTs;

	private String custEmail;

	private String custId;

	private String custMobile;

	private String custName;

	private BigDecimal frezAmt;

	private Date lastUpdTs;

	private int version;

	public ReportConsoleBalanceQuery() {
	}

    @Id
    @SequenceGenerator(name="REPORT_CONSOLE_BALANCE_QUERY_ID_GENERATOR", sequenceName="REPORT_CONSOLE_BALANCE_QRY_SEQ")
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="REPORT_CONSOLE_BALANCE_QUERY_ID_GENERATOR")
    @Column(unique=true, nullable=false, precision=22)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name="ACCT_ID", nullable=false, length=19)
    public String getAcctId() {
        return acctId;
    }

    public void setAcctId(String acctId) {
        this.acctId = acctId;
    }

    @Column(name="ACCT_PROD_CODE", nullable=false, length=10)
    public String getAcctProdCode() {
        return acctProdCode;
    }

    public void setAcctProdCode(String acctProdCode) {
        this.acctProdCode = acctProdCode;
    }

    @Column(name="ACCT_TS", nullable=false)
    public Date getAcctTs() {
        return acctTs;
    }

    public void setAcctTs(Date acctTs) {
        this.acctTs = acctTs;
    }

    @Column(name="BAL_AMT", nullable=false, precision=25, scale=4)
    public BigDecimal getBalAmt() {
        return balAmt;
    }

    public void setBalAmt(BigDecimal balAmt) {
        this.balAmt = balAmt;
    }

    @Column(name="CREATED_TS", nullable=false)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name="CUST_EMAIL", length=50)
    public String getCustEmail() {
        return custEmail;
    }

    public void setCustEmail(String custEmail) {
        this.custEmail = custEmail;
    }

    @Column(name="CUST_ID", nullable=false, length=10)
    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Column(name="CUST_MOBILE", length=150)
    public String getCustMobile() {
    	/***
    	 * 解密处理 ssj 201706016
    	 */
    	return SensitiveInfoUtils.smartDecryptWithCheck(this.custMobile);
    }

    public void setCustMobile(String custMobile) {
        this.custMobile = custMobile;
    }

    @Column(name="CUST_NAME", length=100)
    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    @Column(name="FREZ_AMT", nullable=false, precision=25, scale=4)
    public BigDecimal getFrezAmt() {
        return frezAmt;
    }

    public void setFrezAmt(BigDecimal frezAmt) {
        this.frezAmt = frezAmt;
    }

    @Column(name="LAST_UPD_TS")
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Column(name="\"VERSION\"", nullable=false, precision=22)
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ReportConsoleBalanceQuery that = (ReportConsoleBalanceQuery) o;
        return id == that.id &&
                version == that.version &&
                Objects.equals(acctId, that.acctId) &&
                Objects.equals(acctProdCode, that.acctProdCode) &&
                Objects.equals(acctTs, that.acctTs) &&
                Objects.equals(balAmt, that.balAmt) &&
                Objects.equals(createdTs, that.createdTs) &&
                Objects.equals(custEmail, that.custEmail) &&
                Objects.equals(custId, that.custId) &&
                Objects.equals(custMobile, that.custMobile) &&
                Objects.equals(custName, that.custName) &&
                Objects.equals(frezAmt, that.frezAmt) &&
                Objects.equals(lastUpdTs, that.lastUpdTs);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, acctId, acctProdCode, acctTs, balAmt, createdTs, custEmail, custId, custMobile, custName, frezAmt, lastUpdTs, version);
    }
}